cmake_minimum_required(VERSION 3.0.0)
project(Heyim VERSION 0.1.0)

include(CTest)
enable_testing()

add_definitions("-g2 -o2 -Wall -std=c++2a")

include_directories(

    /usr/local/include

    chatserver
    common
    loop
    tcp
    tcp/listener
    tcp/tcpserver
    tcp/tcpdialer
    proxy
    http
    tlsconfig
    udp
    websocket
    mysql
)

aux_source_directory(chatserver CHATSRC)
aux_source_directory(common COMMONSRC)
aux_source_directory(loop LOOPSRC)
aux_source_directory(tcp TCPSRC)
aux_source_directory(tcp/listener LIETENERSRC)
aux_source_directory(tcp/tcpserver TCPSERVERSRC)
aux_source_directory(tcp/tcpdialer TCPDIALERSRC)
aux_source_directory(http HTTPSRC)
aux_source_directory(proxy PROXYSRC)
aux_source_directory(tlsconfig TLSCONFIGSRC)
aux_source_directory(udp UDPSRC)
aux_source_directory(websocket WEBSOCKETSRC)
aux_source_directory(mysql MYSQLSRC)

link_directories(
    /usr/local/lib
)

link_libraries(
    event-2.1
    pthread
    ssl
    crypto
    event_openssl-2.1
)


add_executable(Heyim 
${CHATSRC} 
${COMMONSRC} 
${LOOPSRC} 
${TCPSRC} 
${LIETENERSRC} 
${TCPSERVERSRC} 
${TCPDIALERSRC}
${HTTPSRC}
${PROXYSRC}
${TLSCONFIGSRC}
${UDPSRC}
${WEBSOCKETSRC}
)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
